/**
 * 
 */
package com.neal.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.neal.service.IAsyncService;


/**
 * @author Neal
 * @version 1.0
 * @description 
 */
@Controller
@RequestMapping("/async")
public class AsyncController {

	
	private IAsyncService asyncService;
	
	@Autowired
	public AsyncController(IAsyncService asyncService) {
		this.asyncService = asyncService;
	}


	@RequestMapping(value="do1", method=RequestMethod.GET)
	public String do1(){
		asyncService.sleep();
		try {
			System.out.println("sleep 3s");
			Thread.sleep(3000);
		}
		catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "index";
	}
	

}
